package com.lovegu.object.down;

/**
 * @author 老顾
 * @title: Test
 * @projectName java-restudy
 * @email: 1437594522@qq.com
 * @date 2022/9/21 18:27
 */
public class Test {
    public static int totalNumber = 5;
    public final int ID;
    public Test() {
        ID = ++totalNumber; // 可在构造器中给final修饰的“变量”赋值
    }
    public static void main(String[] args) {
        Test t = new Test();
        System.out.println(t.ID);
        final int I = 10;
        final int J;
        J = 20;
//        J = 30; // 非法
    }
}
